﻿<%@ Page Language="C#" MasterPageFile="~/EasyUI.master" AutoEventWireup="true"
    CodeBehind="Add.aspx.cs" Inherits="lcsign.Web.documentinfo.Add" Title="增加页" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
     <script type="text/javascript">
        function saveDoc() {
            var DocumentID = "<%=mFileName %>";
            if (DocumentID == "") {
                DocumentID = iStylePDF.Documents.ActiveDocument.FileInformation.FileName;
                if (DocumentID == "")
                    DocumentID = "新建文档.pdf";
            }
            var url = encodeURI("<%=mHttpUrl %>" + "FileSave.aspx?DocumentID=" + DocumentID);
            var result = iStylePDF.HttpClient.UpLoadToServer(url);
            if (result == 200) {
                alert("保存文档成功！");
                window.location.href = "Default.aspx";
            }
            else {
                alert("保存失败，返回值为" + result);
            }
        }
 </script>
<script type="text/javascript" language="javascript" for=iStylePDF event="OnApplicationCreate(App)">
    //控件创建完成事件
    //控件使用的语言
    var lcid = App.Options.Lcid;
    //控件是否高亮域
    //App.Options.HighlightField = false;
    //隐藏下侧的导航工具栏
    App.Options.NavBarVisible = false;
    //隐藏左侧的命令工具栏
    App.Options.TabCommandBarVisible = false;
    //是否允许键盘快捷键操作
    App.Options.EnableAccelerator = true;
    //是否允许打开的文档记录历史记录中
    App.Options.HistoryEnabled = false;
    //设置单文档模式
    App.Options.DocumentsLayout = 0;
    //是否显示起始页
    App.Options.StartPageVisible = false;
    //打开文档100%显示
    //App.Options.PageZoomMode = 1;
    App.Options.UserName = "青岛信元物和供应链有限公司";

    var DocumentID = "<%=mFileName %>";
	if (DocumentID != "") {
	    var url = encodeURI("<%=mHttpUrl %>" + "FileLoad.aspx?DocumentID=" + DocumentID);
	    iStylePDF.HttpClient.DownLoadToFile(url);
        }
    </script>
    
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">    
    <form id="iWebPDF"   method="post" action="DocumentSave.aspx" onSubmit="return SaveDocument();">   
   <div>
       <label>标题：</label><input id="mtitle" /><a href="#" onclick="saveDoc();">保存文档到服务器</a>
   </div>
    <div>
        <label>合同：</label><input id="addfile" type="file" /><input type="button" onclick="openfile()" value="打开"/>
    </div>
    <div>
       图片上传方式： 文件--》创建PDF-->从文件
    </div>
    <div>
        <object  id="iStylePDF" width="100%" height="100%" classid="CLSID:7017318C-BC50-4DAF-9E4A-10AC8364C315" codebase="iStylePDF.cab#version=3,0,6,2155"></object>      
    </div>
    <%--<div>
        状态：<span id="state"></span>
    </div>--%>
    <div><span><a href="#" id="saveFile">保存文档</a></span></div>
    
                    
                   </form>
</asp:Content>

